{include file=header.html}
<style>
    .coupon_list{background:#fff;}
    .coupon_list ul li{padding: 8px 10px 9px 10px;border-bottom: 1px solid #f5f5f5;height: 80px;}
    .coupon_list ul li .pic{width: 100px;height: 80px;margin: 0px 12px 0 0;display: inline-block;overflow: hidden;position: relative;float:left;}
    .coupon_list ul li .info{float:left;}
    .coupon_list ul li .info p{font-size: 12px;height:25px;line-height:25px;overflow: hidden;}
</style>
<script>
    function add_coupon(coupon_id) {
<!--{if !$visitor.user_id}-->
        alert(lang.login_please);
        return;
<!--{/if}-->
        var url = SITE_URL + '/index.php?app=my_coupon&act=add';
        $.getJSON(url, {'coupon_id': coupon_id}, function(data) {
            if (data.done)
            {
                alert(data.retval);
            }
            else
            {
                alert(data.msg);
            }
        });
    }
</script>
<div class="coupon_list">
    <ul class="list">
        <!-- {foreach from=$coupons item=coupon name=fe_coupon} -->
        <a href="javascript:void(0)" onclick="add_coupon({$coupon.coupon_id})">
            <li>
                <div class="pic">
                    <img src="{$site_url}/{$coupon.coupon_bg}" width="100" height="80" />
                </div>
                <div class="info">
                    <p>{$coupon.start_time|date} {$lang.zhi} <!--{if $coupon.end_time}-->{$coupon.end_time|date}<!--{else}-->{$lang.no_limit}<!--{/if}--></p>
                    <p>{$lang.man}{$coupon.min_amount|price}</p>
                    <p>{$lang.can_deduct}{$coupon.coupon_value|price}</p>
                </div>
            </li>
        </a>
        <!--{/foreach}-->
    </ul>
</div>
{include file=footer.html}